package cn.wolfcode.luowowo.website.controller;

import cn.wolfcode.luowowo.common.exception.LogicException;
import cn.wolfcode.luowowo.common.util.AjaxResult;
import cn.wolfcode.luowowo.member.service.IUserInfoService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 验证码资源控制器
 */
@RestController
public class VerifyCodeController {
    @Reference
    private IUserInfoService userInfoService;

    /**
     * 发送短信验证码
     * @param phone 手机号
     * @return
     * @throws LogicException
     */
    @RequestMapping("/sendVerifyCode")
    public Object sendVerifyCode(String phone) throws LogicException {
        userInfoService.sendVerifyCode(phone);
        return new AjaxResult();
    }

}
